<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
	<title></title>
	<script type="text/javascript" src="__dotnar_lib_base_url__/js/lib/require.min.js"></script>
	<script type="text/javascript" src="__dotnar_lib_base_url__/js/lib/loader.js"></script>
    <script type="text/javascript" src="/js/require.config.js"></script>
    <script type="text/javascript">
    require(["core"], function() {
    	require(["./js/pages/default/pays","./js/tools/getarea.js"],function (argument) {
        	window.removeLoader();       	
    	});
    });
    </script>
    
</head>
<body>
    <div style="display:none" id="jSouperApp">
        <xmp>
        {{#include "./pages/mobile/default/top.html"}}

        <div class="block"></div>
        <div class="pays">
            <!-- 收货人信息,支付方式，商品清单 -->
            <div class="ftitle">确认支付订单</div>

            <div class="order_detail">
                <div class="title">填写并核对订单信息</div>

                <div class="item">
                    <div class="title">收货信息</div>
                    <div class="info">
                        <div class="uaddr">
                            {{#if user.pay_ach.info.user_address}}
                                当前选择的收货地址：
                                <span>
                                    {{user.pay_ach.info.user_address.name}}，
                                    {{user.pay_ach.info.user_address.mobilenumber}}，
                                    {{user.pay_ach.info.user_address.province}}
                                    {{user.pay_ach.info.user_address.town}}
                                    {{user.pay_ach.info.user_address.county}}，
                                    {{user.pay_ach.info.user_address.detail}}
                                </span>
                            {{#else}}
                            <p>请选择收获地址</p>
                            {{/if}}
                        </div>
                        {{#each user.address_detail}}
                        <div class="addr">
                            <input type="radio" name="addr" checked="{{$Top.user.pay_ach.info.user_address._id}}" value="{{_id}}" event-click="{{'$Top.$Event.pays.change_user_address'}}"/>
                            <span>{{name}}，{{mobilenumber}} {{phonenumber&&("/"+phonenumber)}}，{{province}}{{town}}{{county}}，{{detail}}</span>
                        </div>
                        {{/each}}
                        <div class="add_address">
                            <div class="text">
                                <div class="addr">      
                                    <select class="province" name="province" event-change={{'$Event.province'}}>
                                        <option class="first" value="0">请选择省</option>
                                        {{#each city_list}}
                                            <option rel="{{region_id}}" value="{{region_name}}">
                                                {{region_name}}
                                            </option>
                                        {{/each}}
                                    </select>

                                    <select class="city" name="city" disabled event-change={{'$Event.city'}}>
                                        <option class="first" value="0">请选择市</option>
                                    </select>

                                    <select class="county" name="area" disabled>
                                        <option class="first" value="0">请选择地区</option>
                                    </select>

                                </div>
                                <input type="text" class="detailed_addre" name="detailed_addre" placeholder="详细地址" maxlength="25" />

                                <div class="connect">
                                    <input type="text" name="name" class="name" placeholder="收货人" maxlength="12" />
                                    <input type="text" name="mobile_num" class="mobile_num" placeholder="联系手机" maxlength="11" />
                                    <input type="text" name="phone_num" class="phone_num" placeholder="座机号码" maxlength="11" />
                                </div>
                            </div>

                            <div class="btn">
                                <input type="button" name="add_btn" class="add_btn" id="add_btn" value="添加地址" event-click="{{'$Event.add_user_address'}}" />
                            </div>
                        </div>
                    </div>
                </div>

                <div class="item">

                    <div class="title">支付方式</div>
                    <div class="info">
                        {{#if user.pay_ach.info.state==config.ACH_STATE.未确认}}
                        <mbPayMethod
                            value="alipay.wap.auth.authAndExecute"
                            text="支付宝"
                            intro="使用支付宝网页支付"
                            disabled="{{!(bus_info.info.alipay.seller_email&&bus_info.info.alipay.key&&bus_info.info.alipay.partner)}}"
                        ></mbPayMethod>
                        <mbPayMethod
                            value="payment_in_cash"
                            text="货到付款"
                            intro="用于大金额订单"
                        ></mbPayMethod>
                        {{#else}}
                            {{#if user.pay_ach.info.pay_method=="alipay.wap.auth.authAndExecute"}}
                            使用支付宝的快捷支付(不可更改)
                            {{/if}}
                            {{#if user.pay_ach.info.pay_method=="payment_in_cash"}}
                            货到付款(不可更改)
                            {{/if}}
                        {{/if}}
                    </div>
                </div>

                <div class="item">
                    <div class="title">商品清单</div>
                    <div class="info">
                        <table>
                            <thead>
                                <td class="goods">商品</td>
                                <td class="price">价格</td>
                                <td class="discount">优惠</td>
                                <td class="count">数量</td>
                            </thead>
                            {{#each user.pay_ach.info.goods_info}}
                            <tr>
                                <td>
                                    <div>
                                    <a href="/goods-details.html?id={{goods._id}}#default/comments">{{goods.goods_name}}</a>
                                    </div>
                                   <!--  <div>
                                        商品编号：{{goods._id}}
                                    </div> -->
                                </td>
                                <td>{{goods.price}}</td>
                                <td>{{(goods.price-goods.cash)||0}}</td>
                                <td>{{num}}</td>
                            </tr>
                            {{/each}}
                            
                        </table>

                        <div class="money">
                            <div class="money-item">
                                <div class="left">商品总金额：</div>
                                <div class="right">{{#Fixed user.pay_ach.sou_cash}}</div>
                            </div>
                            <div class="money-item">
                                <div class="left">优惠：</div>
                                <div class="right">{{#Fixed (user.pay_ach.sou_cash-user.pay_ach.cash)||0}}</div>
                            </div>
                            <div class="money-item">
                                <div class="left">应付金额：</div>
                                <div class="right">{{#if user.pay_ach.cus_cash}}
                                            <span>
                                            <del>{{#Fixed user.pay_ach.cash}}</del>
                                            改：{{#Fixed user.pay_ach.cus_cash}}
                                            </span>
                                        {{#else}}
                                            <span>{{#Fixed user.pay_ach.cash}}</span>
                                        {{/if}}</div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="item">
                    {{#> "user_ach_controller","user.pay_ach"}}
                </div>

            </div>
        </div>




        {{#include "pages/mobile/default/bottom.html"}}
        <xmp type="tag" name="mbPayMethod">
            <div class="pay-type-wrap">
                <input checked="{{user.pay_ach.info.pay_method}}" class="radio" type="radio" bind-input="{{'$Cache.pays.buy_method'}}" name="pay-type" event-change="{{'$Event.pays.change_pay_method'}}" ${__all_attrs__} />
                <div class="pay-type pay3" name="pay3" event-click="{{'$Event.changepay'}}">
                ${text}<span>${intro}</span>
                </div>
            </div>
            <script type="text/vm">
                function(vm){
                    require(['common','jQuery'],function(jSouper,$){
                        vm.set('whichpay','pay1');
                        vm.set('$Event.changepay',function(e,vm){
                            $(this).find('.radio').click();
                            vm.set('whichpay',$(this).attr('name'));
                        })
                    })
                }
            </script>
        </xmp>
        </xmp>

    </div>


</body>
</html>

